
    ##############################################################################################
    # R code for Tables 1, S2, and S3
    # The implementation requires "rogue_by_bill_Senate.csv" and "rogue_by_bill_House.csv".
    ##############################################################################################

    setwd("C:\\0Jeong\\1_Projects\\Foreign_Policy\\11_Rogue_States\\drafts\\FPA_revision\\replication_material") # change it accordingly
  

    #################################
    ### Senate Results

    Data <- read.csv("rogue_by_bill_Senate.csv", header=T)
    names(Data)
    dim(Data)
   
    Data$party_consensus <- -Data$party_gap

    # Dataset without Sudan or Syria Bills
    Data1 <- subset(Data, Sudan==0 & Syria==0)
    dim(Data1)    

    # Dataset without Sudan, Syria, or Cuba Bills
    Data2 <- subset(Data1, Cuba==0)
    dim(Data2)    


    # Table 1 - Senate
   
    model_1 <- lm(party_consensus ~ humanitarian + conciliatory + GOP_prez + Cuba + Iran + Iraq + Libya, data=Data1) 
    summary(model_1)                                                             
    model_dem_yea_1 <- lm(Dem_yea ~ humanitarian + conciliatory + GOP_prez + Cuba + Iran + Iraq + Libya, data=Data1) 
    summary(model_dem_yea_1)                                                     
    model_GOP_yea_1 <- lm(GOP_yea ~ humanitarian + conciliatory + GOP_prez + Cuba + Iran + Iraq + Libya, data=Data1) 
    summary(model_GOP_yea_1)
 

    # Table S2 - Senate
   
    model_S2 <- lm(party_consensus ~ humanitarian + conciliatory + GOP_prez + Iran + Iraq + Libya, data=Data2) 
    summary(model_S2)
    model_dem_yea_S2 <- lm(Dem_yea ~ humanitarian + conciliatory + GOP_prez + Iran + Iraq + Libya, data=Data2) 
    summary(model_dem_yea_S2)
    model_GOP_yea_S2 <- lm(GOP_yea ~ humanitarian + conciliatory + GOP_prez + Iran + Iraq + Libya, data=Data2) 
    summary(model_GOP_yea_S2)
 

    # Table S3 - Senate

    model_S3 <- lm(party_consensus ~ humanitarian + conciliatory + GOP_prez + Cuba + Iran + Iraq + Libya + Sudan + Syria, data=Data) 
    summary(model_S3)
    model_dem_yea_S3 <- lm(Dem_yea ~ humanitarian + conciliatory + GOP_prez + Cuba + Iran + Iraq + Libya + Sudan + Syria, data=Data) 
    summary(model_dem_yea_S3)
    model_GOP_yea_S3 <- lm(GOP_yea ~ humanitarian + conciliatory + GOP_prez + Cuba + Iran + Iraq + Libya + Sudan + Syria, data=Data) 
    summary(model_GOP_yea_S3)


    ###################################
    ### House Results

    Data <- read.csv("rogue_by_bill_House.csv", header=T)
    names(Data)
    dim(Data)
   
    Data$party_consensus <- -Data$party_gap

    # Dataset without Sudan or Syria Bills
    Data1 <- subset(Data, Sudan==0 & Syria==0)
    dim(Data1)    

    # Dataset without Sudan, Syria, or Cuba Bills
    Data2 <- subset(Data1, Cuba==0)
    dim(Data2)    


    # Table 1 - House
   
    model_1 <- lm(party_consensus ~ humanitarian + conciliatory + GOP_prez + Cuba + Iran + Iraq + Libya, data=Data1) 
    summary(model_1)                                                             
    model_dem_yea_1 <- lm(Dem_yea ~ humanitarian + conciliatory + GOP_prez + Cuba + Iran + Iraq + Libya, data=Data1) 
    summary(model_dem_yea_1)                                                     
    model_GOP_yea_1 <- lm(GOP_yea ~ humanitarian + conciliatory + GOP_prez + Cuba + Iran + Iraq + Libya, data=Data1) 
    summary(model_GOP_yea_1)
 

    # Table S2 - House
   
    model_S2 <- lm(party_consensus ~ humanitarian + conciliatory + GOP_prez + Iran + Iraq + Libya, data=Data2) 
    summary(model_S2)
    model_dem_yea_S2 <- lm(Dem_yea ~ humanitarian + conciliatory + GOP_prez + Iran + Iraq + Libya, data=Data2) 
    summary(model_dem_yea_S2)
    model_GOP_yea_S2 <- lm(GOP_yea ~ humanitarian + conciliatory + GOP_prez + Iran + Iraq + Libya, data=Data2) 
    summary(model_GOP_yea_S2)
 

    # Table S3 - House

    model_S3 <- lm(party_consensus ~ humanitarian + conciliatory + GOP_prez + Cuba + Iran + Iraq + Libya + Sudan + Syria, data=Data) 
    summary(model_S3)
    model_dem_yea_S3 <- lm(Dem_yea ~ humanitarian + conciliatory + GOP_prez + Cuba + Iran + Iraq + Libya + Sudan + Syria, data=Data) 
    summary(model_dem_yea_S3)
    model_GOP_yea_S3 <- lm(GOP_yea ~ humanitarian + conciliatory + GOP_prez + Cuba + Iran + Iraq + Libya + Sudan + Syria, data=Data) 
    summary(model_GOP_yea_S3)



